package demo;

public class People {
    String name;
    private int age;

    public void setAge(int age){
        if(age <0){
            System.out.println("年龄设置有误，请重新输入");
            return;
        }
        this.age = age;
    }

    public int getAge(){
        return this.age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    void eat(){
        System.out.println("使用筷子吃饭");
    }

    void drink(){
        System.out.println("喜欢喝果汁");
    }
}
